#ifndef _TW2815_LINUX
#define _TW2815_LINUX
//video_mode
#define AUTOMATICALLY 0
#define NTSC 1
#define PAL 2


typedef struct hitw2815_w_reg
{
    unsigned int addr;
    unsigned int value;
}tw2815_w_reg;

typedef struct hitw2815_set_2d1
{
    unsigned int ch1;
    unsigned int ch2;
}tw2815_set_2d1;

typedef struct hitw2815_set_videomode
{
  // unsigned int ch;
   unsigned int mode;
}tw2815_set_videomode;
typedef struct hitw2815_set_controlvalue
{
   unsigned int ch;
   unsigned int controlvalue;
}tw2815_set_controlvalue;

#define TW2815_READ_REG 0x0
#define TW2815_WRITE_REG 0x1
#define TW2815_SET_ADA_PLAYBACK_SAMPLERATE  0x2
#define TW2815_SET_ADA_PLAYBACK_BITWIDTH  0x3
#define TW2815_SET_ADA_PLAYBACK_BITRATE   0x4 
#define TW2815_SET_D1   0x5
#define TW2815_SET_2_D1     0x6
#define TW2815_SET_4HALF_D1 0x7
#define TW2815_SET_4_CIF    0x8
#define TW2815_SET_AUDIO_OUTPUT    0x9
#define TW2815_SET_AUDIO_MIX_OUT     0x10
#define TW2815_SET_AUDIO_RECORD_M  0x11
#define TW2815_SET_MIX_MUTE     0x12
#define TW2815_CLEAR_MIX_MUTE   0x13
#define TW2815_SET_ADA_SAMPLERATE 0x14
#define TW2815_SET_ADA_BITWIDTH   0x15
#define TW2815_SET_ADA_BITRATE   0x16
#define TW2815_SET_VIDEO_MODE 0x17

#define TW2815_GET_ADA_PLAYBACK_SAMPLERATE  0x18
#define TW2815_GET_ADA_PLAYBACK_BITWIDTH   0x19
#define TW2815_GET_ADA_PLAYBACK_BITRATE   0x20
//#define TW2815_GET_D1   0x21
//#define TW2815_GET_2_D1     0x22
//#define TW2815_GET_4HALF_D1  0x23
//#define TW2815_GET_4_CIF    0x24
#define TW2815_GET_AUDIO_OUTPUT     0x25
//#define TW2815_GET_AUDIO_MIX_OUT     0x26
//#define TW2815_GET_AUDIO_RECORD_M   0x27
//#define TW2815_GET_MIX_MUTE     0x28
//#define TW2815_GET_MIX_MUTE_CLEAR   0x29
#define TW2815_GET_ADA_SAMPLERATE  0x30
#define TW2815_GET_ADA_BITWIDTH   0x31
#define TW2815_GET_ADA_BITRATE   0x32
#define TW2815_GET_VIDEO_MODE 0x33
#define TW2815_REG_DUMP  0x34
#define TW2815_SET_CHANNEL_SEQUENCE 0x35
#define TW2815_SET_AUDIO_CASCAD 0x36


#define TW2815_HUE_CONTROL 0x37
#define TW2815_SATURATION_CONTROL 0x38
#define TW2815_CONTRAST_CONTROL 0x39
#define TW2815_BRIGHTNESS_CONTROL 0x40
#define TW2815_LUMINANCE_PEAKING_CONTROL 0x41
#define TW2815_CTI_CONTROL 0x42

#define TW2815_GET_HUE_SET 0x43 
#define TW2815_GET_SATURATION_SET 0x44
#define TW2815_GET_CONTRAST_SET 0x45 
#define TW2815_GET_BRIGHTNESS_SET 0x46
#define TW2815_GET_LUMINANCE_PEAKING_SET 0x47
#define TW2815_GET_CTI_SET 0x48
#define TW2815_SET_PLAYBACK_MODE 0x49
#define TW2815_SET_CLOCK_OUTPUT_DELAY 0x50
#if 0

#define TW2815_READ_REG _IOWR('T', 1,int)
#define TW2815_WRITE_REG _IOWR('T', 2,tw2815_w_reg)
#define TW2815_SET_ADA_PLAYBACK_SAMPLERATE  _IOWR('T', 3,int)
#define TW2815_SET_ADA_PLAYBACK_BITWIDTH  _IOWR('T', 4,int) 
#define TW2815_SET_ADA_PLAYBACK_BITRATE   _IOWR('T', 5,int) 
#define TW2815_SET_D1   _IOWR('T', 6,int)
#define TW2815_SET_2_D1     _IOWR('T', 7,tw2815_set_2d1)
#define TW2815_SET_4HALF_D1  _IOWR('T', 8,int)
#define TW2815_SET_4_CIF    _IOWR('T', 9,int)
#define TW2815_SET_AUDIO_OUTPUT     _IOWR('T', 10,int)
#define TW2815_SET_AUDIO_MIX_OUT     _IOWR('T', 11,int)
#define TW2815_SET_AUDIO_RECORD_M  _IOWR('T', 12,int)
#define TW2815_SET_MIX_MUTE     _IOWR('T', 13,int)
#define TW2815_CLEAR_MIX_MUTE   _IOWR('T', 14,int)
#define TW2815_SET_ADA_SAMPLERATE  _IOWR('T', 15,int)
#define TW2815_SET_ADA_BITWIDTH   _IOWR('T', 16,int)
#define TW2815_SET_ADA_BITRATE   _IOWR('T', 17,int)
#define TW2815_SET_VIDEO_MODE _IOWR('T', 18,int)

#define TW2815_GET_ADA_PLAYBACK_SAMPLERATE  _IOWR('T', 19,int)
#define TW2815_GET_ADA_PLAYBACK_BITWIDTH   _IOWR('T', 20,int)
#define TW2815_GET_ADA_PLAYBACK_BITRATE   _IOWR('T', 21,int)
//#define TW2815_GET_D1   _IOWR('T', 22,int)
//#define TW2815_GET_2_D1     _IOWR('T', 23,int)
//#define TW2815_GET_4HALF_D1  _IOWR('T', 24,int)
//#define TW2815_GET_4_CIF    _IOWR('T', 25,int)
#define TW2815_GET_AUDIO_OUTPUT     _IOWR('T', 26,int)
//#define TW2815_GET_AUDIO_MIX_OUT     _IOWR('T', 27,int)
//#define TW2815_GET_AUDIO_RECORD_M   _IOWR('T', 28,int)
//#define TW2815_GET_MIX_MUTE     _IOWR('T', 29,int)
//#define TW2815_GET_MIX_MUTE_CLEAR   _IOWR('T', 30,int)
#define TW2815_GET_ADA_SAMPLERATE  _IOWR('T', 31,int)
#define TW2815_GET_ADA_BITWIDTH   _IOWR('T', 32,int)
#define TW2815_GET_ADA_BITRATE   _IOWR('T', 33,int)
#define TW2815_GET_VIDEO_MODE _IOWR('T', 34,int)
#define TW2815_REG_DUMP  _IOWR('T', 35,int)

#endif


#define SET_8K_SAMPLERATE 0
#define SET_16K_SAMPLERATE 1
#define SET_8_BITWIDTH 1
#define SET_16_BITWIDTH 0
#define SET_256_BITRATE 0
#define SET_384_BITRATE 1
#define SET_AUDIO_CASCAD 0
#define SET_AUDIO_SINGLE 1
#define MASTER 1
#define SLAVER 0










typedef enum Tw2815Ret_
    {
	
	TW2815_IOCTL_FAIL =-1,	
	TW2815_IOCTL_OK = 0,    
    	TW2815_SET_D1_FAIL , 
    	TW2815_SET_2_D1_FAIL ,
    	TW2815_SET_4HALF_D1_FAIL ,
    	TW2815_SET_4_CIF_FAIL  ,
    	TW2815_SET_AUDIO_OUTPUT_FAIL ,
    	TW2815_SET_ADA_SAMPLERATE_FAIL ,
    	TW2815_SET_ADA_BITWIDTH_FAIL ,
    	TW2815_SET_ADA_BITRATE_FAIL ,
    	TW2815_SET_ADA_PLAYBACK_SAMPLERATE_FAIL ,
    	TW2815_SET_ADA_PLAYBACK_BITWIDTH_FAIL ,
    	TW2815_SET_ADA_PLAYBACK_BITRATE_FAIL ,
    	TW2815_SET_VIDEO_MODE_FAIL ,
    	TW2815_SET_CHANNEL_SEQUENCE_FAIL ,
	TW2815_SET_AUDIO_CASCAD_FAIL ,    	
	TW2815_SET_MIX_MUTE_FAIL ,    	
	TW2815_CLEAR_MIX_MUTE_FAIL ,     	
        TW2815_HUE_CONTROL_FAIL,
        TW2815_SATURATION_CONTROL_FAIL,
        TW2815_CONTRAST_CONTROL_FAIL,
        TW2815_BRIGHTNESS_CONTROL_FAIL,
        TW2815_LUMINANCE_PEAKING_FAIL,
        TW2815_CTI_CONTROL_FAIL,
        TW2815_GET_HUE_SET_FAIL,
        TW2815_GET_SATURATION_SET_FAIL,
        TW2815_GET_CONTRAST_SET_FAIL,
        TW2815_GET_BRIGHTNESS_SET_FAIL,
        TW2815_GET_LUMINANCE_PEAKING_SET_FAIL,
        TW2815_GET_CTI_SET_FAIL,
        TW2815_READ_REG_FAIL,
        TW2815_WRITE_REG_FAIL,
        TW2815_GET_VIDEO_MODE_FAIL,
        TW2815_SET_AUDIO_MIX_OUT_FAIL,
        TW2815_SET_AUDIO_RECORD_M_FAIL,
        TW2815_SET_PLAYBACK_MODE_FAIL,
        TW2815_SET_CLOCK_OUTPUT_DELAY_FAIL,
}Tw2815Ret;

#endif
